#ifndef __LEVEL_PARSER_H__
#define __LEVEL_PARSER_H__
#include "LevelConf.h"

namespace gofgame { 
	namespace dungeonkeeper {
		namespace configuration {
			class LevelParser : public cocos2d::CCSAXDelegator{
			public:
				LevelParser();
				static LevelParser * getSharedLevelParser();
				LevelConf* parse(char *fileName);
			public:
				virtual void startElement(void *ctx, const char *name, const char **atts);
				virtual void endElement(void *ctx, const char *name);
				virtual void textHandler(void *ctx, const char *s, int len);
			private:
				LevelConf *tempLevel;
				UnitConf *tempUnitConf;
				PeriodConf *tempPeriodConf;
				bool unitFlag;
				bool periodFlag;
			};
		}
	}
}

#endif //__LEVEL_PARSER_H__
